package com.xiaolei.lib.annotation.translators;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import com.xiaolei.lib.Activity.IActivity;
import com.xiaolei.lib.Activity.bean.AnnotationWrape;
import com.xiaolei.lib.annotation.getIntent;
import com.xiaolei.lib.annotation.factory.TranslatorFactory;
import com.xiaolei.lib.core.ITranslator;

import android.content.Intent;

public class getIntent_getInt_Translator implements ITranslator
{
	@Override
	public void execute(Field field, IActivity activity, AnnotationWrape annotation)
	{
		Intent intent = activity.getIntent();
		getIntent.getInt gInt = annotation.get(getIntent.getInt.class);
		int value = intent.getIntExtra(gInt.name(),gInt.defaultValue());
		getIntent_getInt_Translator2 gTranslator2 = TranslatorFactory.getTranslator(getIntent_getInt_Translator2.class);
		gTranslator2.setValue(field, activity, value);
	}

	@Override
	public void execute(Method method, IActivity activity, AnnotationWrape annotation)
	{
		// TODO Auto-generated method stub

	}

	@Override
	public void execute(Class<?> type, IActivity activity, AnnotationWrape annotation)
	{
		// TODO Auto-generated method stub

	}

}
